#coding=utf-8
#!/usr/bin/env python
import sys,os

def countException(logFile):
    syscmd = 'egrep -o "[A-Z]\w*Exception" '+logFile+'|sort|uniq';
    cmdResult = os.system(syscmd);
    
    print cmdResult;
    
    

if __name__=='__main__':
    if len(sys.argv) != 2:
        print "\ncountexception.py : Find exception count  log.\n"
        print "\nUsage : ./countexception.py\n"
        print "\nexemple: ./countexception.py trace.log \n"
        sys.exit(1)
        
    countException(sys.argv[1]);
    
    
